package controllers

import (
	"go-jhb-admin-api/app/models"
	"go-jhb-admin-api/app/utils"

	"github.com/gin-gonic/gin"
)

// jhb 业务
func GetFriendsCircleDetail(c *gin.Context) {

	var data struct {
		Id uint `form:"id" binding:"required"`
	}

	// 绑定请求参数到结构体
	if err := c.ShouldBind(&data); err != nil {
		utils.ErrorResponse(c, nil, "参数错误")
		return
	}

	var detail models.FriendsCircle

	if getErr := detail.GetByID(data.Id); getErr != nil {
		utils.ErrorResponse(c, nil, "获取失败,"+getErr.Error())
		return
	}

	utils.SuccessResponse(c, detail)
}
